<template>
  <div class="mylist">
    <p class="title">
      <span class="el-icon-medal-1"></span>
      <span class="title-text">本周药品销售排行</span>
    </p>
    <div >
      <div class="sort" v-for="item in List" :key="item.id">
        <span class="code" style="width: 40px">{{ item.id }}.</span>
        <p class="digital">
          <span class="digcode">{{ item.code }}</span>
          <span>{{ item.name }}</span>
          <span class="add" >添加</span>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
import {DrugListApi} from '../../../api/DrugDatil'
export default {
  data(){
    return{
      List:[],
    }
  },
  mounted(){
      this.initList();
  },
  methods:{
    initList(){
        DrugListApi().then(res=>{
          this.List = res.data;
        })
    }
  }
};
</script>

<style lang="less" scoped>
.mylist {
  // width: 500px;
  height: 450px;
  padding: 10px 20px;
  overflow: auto;
  .title {
    margin-bottom: 15px;
    .el-icon-medal-1 {
      color: #f8d639;
      font-size: 18px;
      margin: 0 10px;
    }
    .title-text {
      font-size: 16px;
      font-weight: 600;
    }
  }
  .sort {
    display: flex;
    height: 30px;
    line-height: 30px;
    margin-bottom: 15px;
    .code {
      color: #666ee8;
      font-size: 16px;
      font-weight: 600;
      margin: 0 10px;
    }
    .digital {
      width: 370px;
      border: 1px solid #e5e5e5;
      border-radius: 5px;
      padding: 0 20px;
      .digcode {
        color: grey;
        margin-right: 60px;
      }
      .add {
        float: right;
        color: #9298ef;
      }
    }
  }
}
</style>